const a = [1, 2, 3];
const buf1 = Buffer.from(a);
console.log(a, buf1.toJSON());
a[0] = 111;
console.log(a, buf1.toJSON()); // array 改了, 但是buffer不变

const b = new Uint8Array([1, 2, 3]);
const buf2 = Buffer.from(b.buffer);
console.log(b, buf2.toJSON());
b[0] = 111;
console.log(b, buf2.toJSON());
